package com.zhangxx.common.response;

import com.zhangxx.common.response.resultCode.ResultCode;
import lombok.Data;

/**
 * @ClassName ResultData
 * @Description 数据返回
 * @Author leizhang
 * Date 2020/12/14 12:04 上午
 * @Version 1.0
 **/
@Data
public class ResponseData<T> implements Response {
    /**
     操作是否成功
     **/
    boolean success = SUCCESS;

    /**
     操作代码
     **/
    int code = SUCCESS_CODE;

    /**
     提示信息
     **/
    T data;

    public ResponseData(T data, ResultCode resultCode){
        this.success = resultCode.success();
        this.code = resultCode.code();
        this.data = data;
    }
}
